<div class="smart-rightPanel layui-form">
    <div class="layui-anim layui-anim-upbit">
        <blockquote class="site-text layui-elem-quote">

        </blockquote>
        <table id="list_table" class="layui-hide" lay-filter="mainList"></table>
    </div>
</div>
<script>
    layui.use(['layer', 'table', 'form','jquery'], function () {
        var layer = layui.layer;
        var table = layui.table;
        var form = layui.form;
        var  $ = layui.jquery;
        var tableObj = table.render({
            id: 'list_table'
            , elem: '#list_table'
            , url: 'buss/set'
            , align: "center"
            , cols: [[ //表头
                 {field: 'id', title: '编号',align: 'center',hide:true}
                , {field: 'zuixiao', title: '打卡最小保障金',  align: 'center'}
                , {field: 'beilv', title: '打卡中奖倍率',  align: 'center'}
                , {field: 'bili', title: '奖池占打卡金的比例',  align: 'center'}
                , {field: 'daoqi', title: '打卡奖励到期时间', align: 'center'}
                , {field: 'rate', title: '任务金比例',  align: 'center'}
                , {field: 'zuida', title: '单徒弟任务金', align: 'center'}
                , {field: 'tixian', title: '提现的最低金额', align: 'center'}
                , {field: 'prizenum', title: '每期奖品数量', align: 'center'}

                , {field: 'lock', title: '操作', width: 140, templet: function (d) {
                        return '<button class="layui-btn layui-btn-warm layui-btn-sm" lay-event="edit">修改</button>';
                    }, unresize: true, align: 'center'}
            ]]
            , done :function(res,curr,count){
                $(".layui-table-box").find("[data-field='id']").css("display","none");
            }
        });

        $("#search").click(function () {
            reloadTable(tableObj);
        });


        //表格内部操作按钮监听
        table.on('tool(mainList)', function (obj) {
            var data = obj.data;
            var layEvent = obj.event;
            if (layEvent === 'edit') {
                showDialog({
                    title: '修改',
                    template: 'edit',
                    saveUrl: 'buss/set/save',
                    tableObj: tableObj,
                    htmlData: data,
                    width : 750
                })
            }
        });
    });
</script>

